<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: Globalize::CoreExtensions::String</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">Globalize::CoreExtensions::String</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/globalize/lib/globalize/localization/core_ext_rb.html">
                vendor/plugins/globalize/lib/globalize/localization/core_ext.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000029">/</a>&nbsp;&nbsp;
      <a href="#M000028">&gt;&gt;</a>&nbsp;&nbsp;
      <a href="#M000025">t</a>&nbsp;&nbsp;
      <a href="#M000027">tn</a>&nbsp;&nbsp;
      <a href="#M000024">translate</a>&nbsp;&nbsp;
      <a href="#M000026">translate_with_namespace</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">direction</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
Indicates direction of text (usually <tt>ltr</tt> [left-to-right] or
<tt>rtl</tt> [right-to-left].

</td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000029" class="method-detail">
        <a name="M000029"></a>

        <div class="method-heading">
          <a href="#M000029" class="method-signature">
          <span class="method-name">/</span><span class="method-args">(arg)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Translates the string into the active language. This is equivalent to <a
href="String.html#M000024">translate</a>(arg).
</p>
<p>
Example: <tt>&quot;There are %d items in your cart&quot; / 1 -&gt;
&quot;There is one item in your cart&quot;</tt>
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000029-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/globalize/lib/globalize/localization/core_ext.rb, line 54</span>
54:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">/</span>(<span class="ruby-identifier">arg</span>)
55:         <span class="ruby-identifier">translate</span>(<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">arg</span>)
56:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000028" class="method-detail">
        <a name="M000028"></a>

        <div class="method-heading">
          <a href="#M000028" class="method-signature">
          <span class="method-name">&gt;&gt;</span><span class="method-args">(namespace)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Translates the string into the active language using the supplied
namespace. This is equivalent to <a
href="String.html#M000026">translate_with_namespace</a>(arg).
</p>
<p>
Example:
</p>
<pre>
         &lt;tt&gt;&quot;draw&quot;.t -&gt; &quot;dibujar&quot;&lt;/tt&gt;
         &lt;tt&gt;&quot;draw&quot; &gt;&gt; 'lottery' -&gt; &quot;seleccionar&quot;&lt;/tt&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000028-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/globalize/lib/globalize/localization/core_ext.rb, line 46</span>
46:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&gt;&gt;</span>(<span class="ruby-identifier">namespace</span>)
47:         <span class="ruby-identifier">translate_with_namespace</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>)
48:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000025" class="method-detail">
        <a name="M000025"></a>

        <div class="method-heading">
          <span class="method-name">t</span><span class="method-args">(default = nil, arg = nil, namespace = nil)</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="String.html#M000024">translate</a>
</p>
        </div>
      </div>

      <div id="method-M000027" class="method-detail">
        <a name="M000027"></a>

        <div class="method-heading">
          <span class="method-name">tn</span><span class="method-args">(namespace, arg = nil, default = nil)</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="String.html#M000026">translate_with_namespace</a>
</p>
        </div>
      </div>

      <div id="method-M000024" class="method-detail">
        <a name="M000024"></a>

        <div class="method-heading">
          <a href="#M000024" class="method-signature">
          <span class="method-name">translate</span><span class="method-args">(default = nil, arg = nil, namespace = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Translates the string into the active language. If there is a quantity
involved, it can be set with the <tt>arg</tt> parameter. In this case
string should contain the code <tt>%d</tt>, which will be substituted with
the supplied number.
</p>
<p>
To substitute a <tt>string</tt>, give it as the <tt>arg</tt> parameter. It
will be substituted for &lt;tt&gt;%s&lt;/dd&gt;.
</p>
<p>
If there is no translation available, <tt>default</tt> will be returned, or
if it&#8216;s not supplied, the original string will be returned.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000024-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/globalize/lib/globalize/localization/core_ext.rb, line 23</span>
23:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">translate</span>(<span class="ruby-identifier">default</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">arg</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">namespace</span> = <span class="ruby-keyword kw">nil</span>)
24:         <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">translate</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">namespace</span>)
25:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000026" class="method-detail">
        <a name="M000026"></a>

        <div class="method-heading">
          <a href="#M000026" class="method-signature">
          <span class="method-name">translate_with_namespace</span><span class="method-args">(namespace, arg = nil, default = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Translates the string into the active language using the supplied
namespace.
</p>
<p>
Example:
</p>
<pre>
         &lt;tt&gt;&quot;draw&quot;.t -&gt; &quot;dibujar&quot;&lt;/tt&gt;
         &lt;tt&gt;&quot;draw&quot;.tn(:lottery) -&gt; &quot;seleccionar&quot;&lt;/tt&gt;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000026-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/globalize/lib/globalize/localization/core_ext.rb, line 34</span>
34:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">translate_with_namespace</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-identifier">arg</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">default</span> = <span class="ruby-keyword kw">nil</span>)
35:         <span class="ruby-constant">Locale</span>.<span class="ruby-identifier">translate</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">namespace</span>.<span class="ruby-identifier">to_s</span>)
36:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>